142 research outputs found

    Transformations of Logic Programs with Goals as Arguments

    Full text link
    We consider a simple extension of logic programming where variables may range over goals and goals may be arguments of predicates. In this language we can write logic programs which use goals as data. We give practical evidence that, by exploiting this capability when transforming programs, we can improve program efficiency. We propose a set of program transformation rules which extend the familiar unfolding and folding rules and allow us to manipulate clauses with goals which occur as arguments of predicates. In order to prove the correctness of these transformation rules, we formally define the operational semantics of our extended logic programming language. This semantics is a simple variant of LD-resolution. When suitable conditions are satisfied this semantics agrees with LD-resolution and, thus, the programs written in our extended language can be run by ordinary Prolog systems. Our transformation rules are shown to preserve the operational semantics and termination.Comment: 51 pages. Full version of a paper that will appear in Theory and Practice of Logic Programming, Cambridge University Press, U

    Transformation Rules for Locally Stratified Constraint Logic Programs

    Full text link
    We propose a set of transformation rules for constraint logic programs with negation. We assume that every program is locally stratified and, thus, it has a unique perfect model. We give sufficient conditions which ensure that the proposed set of transformation rules preserves the perfect model of the programs. Our rules extend in some respects the rules for logic programs and constraint logic programs already considered in the literature and, in particular, they include a rule for unfolding a clause with respect to a negative literal.Comment: To appear in: M. Bruynooghe, K.-K. Lau (Eds.) Program Development in Computational Logic, Lecture Notes in Computer Science, Springe

    Methodologies for transformations and memoing in applicative languages

    Get PDF

    Automata theory and formal languages

    Get PDF
    These lecture notes present some basic notions and results on Automata Theory, Formal Languages Theory, Computability Theory, and Parsing Theory. I prepared these notes for a course on Automata, Languages, and Translators which I am teaching at the University of Roma Tor Vergata. More material on these topics and on parsing techniques for context-free languages can be found in standard textbooks such as [1, 8, 9]. The reader is encouraged to look at those books. A theorem denoted by the triple k.m.n is in Chapter k and Section m, and within that section it is identified by the number n. Analogous numbering system is used for algorithms, corollaries, definitions, examples, exercises, figures, and remarks. We use ‘iff’ to mean ‘if and only if’. Many thanks to my colleagues of the Department of Informatics, Systems, and Production of the University of Roma Tor Vergata. I am also grateful to my stu- dents and co-workers and, in particular, to Lorenzo Clemente, Corrado Di Pietro, Fulvio Forni, Fabio Lecca, Maurizio Proietti, and Valerio Senni for their help and encouragement. Finally, I am grateful to Francesca Di Benedetto, Alessandro Colombo, Donato Corvaglia, Gioacchino Onorati, and Leonardo Rinaldi of the Aracne Publishing Com- pany for their kind cooperation

    Elements of concurrent programming (Third edition)

    Get PDF
    These lecture notes are intended to introduce the reader to the basic notions of nondeterministic and concurrent programming. We start by giving the operational semantics of a simple deterministic language and the operational semantics of a simple nondeterministic language based on guarded commands. Then we consider concurrent computations based on: (i) vectorization, (ii) shared variables, and (iii) handshaking communications à la CCS (Calculus for Communicating Systems) [16]. We also address the problem of mutual exclusion and for its solution we analyze various techniques such as those based on semaphores, critical regions, conditional critical regions, and monitors. Finally, we study the problem of detecting distributed termination and the problem of the serializability of database transactions. Sections 1, 2, and 6 are based on [16,22]. The material of Sections 3 and 4 is derived from [1,2,4,5,7,8,13,18,20]. Section 5 is based on [10] and is devoted to programming examples written in Java where the reader may see in action some of the basic techniques described in these lecture notes. In Section 7 we closely follow [3]. We would like to thank Dr. Maurizio Proietti for his many suggestions and his encouragement, Prof. Robin Milner and Prof. Matthew Hennessy for introducing me to CCS, Prof. Vijay K. Garg from whose book [10] I learnt concurrent programming in Java, my colleagues at Roma Tor Vergata University for their support and friendship, and my students for their patience and help. Many thanks also to Dr. Gioacchino Onorati and Lorenzo Costantini of the Aracne Publishing Company for their kind and helpful cooperation. Roma, April 2005 In the third edition we have corrected a few mistakes, we have improved Chapter 2, and we have added in the Appendix a Java program for the distributed computation of spanning trees of undirected graphs. Thanks to Dr. Emanuele De Angelis for discovering an error in the presentation of Peterson’s algorithm. Roma, January 200

    Program Transformation for Development, Verification, and Synthesis of Software

    Get PDF
    In this paper we briefly describe the use of the program transformation methodology for the development of correct and efficient programs. We will consider, in particular, the case of the transformation and the development of constraint logic programs

    Transformational Verification of Linear Temporal Logic

    Get PDF
    We present a new method for verifying Linear Temporal Logic (LTL) properties of finite state reactive systems based on logic programming and program transformation. We encode a finite state system and an LTL property which we want to verify as a logic program on infinite lists. Then we apply a verification method consisting of two steps. In the first step we transform the logic program that encodes the given system and the given property into a new program belonging to the class of the so-called linear monadic !-programs (which are stratified, linear recursive programs defining nullary predicates or unary predicates on infinite lists). This transformation is performed by applying rules that preserve correctness. In the second step we verify the property of interest by using suitable proof rules for linear monadic !-programs. These proof rules can be encoded as a logic program which always terminates, if evaluated by using tabled resolution. Although our method uses standard program transformation techniques, the computational complexity of the derived verification algorithm is essentially the same as the one of the Lichtenstein-Pnueli algorithm [9], which uses sophisticated ad-hoc techniques
    corecore